package main

import (
	"fmt"
	"strings"
)

type Person struct {
	firstName string
	lastName  string
}

func upPerson(p *Person) {
	p.firstName = strings.ToUpper(p.firstName)
	p.lastName = strings.ToUpper(p.lastName)
}

func getName(p *Person) string {
	return p.firstName + " " + p.lastName
}

func main() {
	per1 := Person{"Han", "meimei"}
	upPerson(&per1)
	fmt.Println("per1: ", getName(&per1))

	per2 := new(Person)
	per2.firstName = "Li"
	per2.lastName = "Lei"
	upPerson(per2)
	fmt.Println("per2: ", getName(per2))

	var per3 Person
	per3.firstName = "zhang"
	per3.lastName = "shan"
	upPerson(&per3)
	fmt.Println("per3: ", getName(&per3))

	per4 := &Person{"lin", "tao"}
	upPerson(per4)
	fmt.Println("per4: ", getName(per4))
}
